home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Apple Guide / Engineering / APISample / APISampleCW / Source / UDoc.h < prev    next >
Encoding:
Text File  |  1994-03-13  |  2.0 KB  |  86 lines  |  [TEXT/MPS ]

  1. // Copyright ©1994 Apple Computer, Inc.
  2. // Author: John Powers
  3. // Date:   04-Aug-93
  4.  
  5. // UDoc.h
  6. // Header for document, art, and related classes.
  7.  
  8. #ifndef __UDOC__
  9. #define __UDOC__                // #endif __UDOC__ is at end of this file
  10.  
  11. // Most of the includes are covered in UApp.h
  12.  
  13. #include <Windows.h>
  14.  
  15. #ifndef __UAPP__
  16.     #include "UApp.h"
  17. #endif
  18.  
  19. // Constants (also see UAppShared.h).
  20. // ------------------------------------------------------------------------
  21.  
  22. #define    override virtual
  23.  
  24. // Forward references
  25. // ------------------------------------------------------------------------
  26.  
  27. class TScrap;
  28. class TApp;
  29.  
  30. // ------------------------------------------------------------------------
  31. // A base class our window classes.
  32. // Manages everything inside the window.
  33. //
  34.  
  35. class TDoc : public TDocument
  36. {
  37.     private:
  38.     protected:
  39.         TApp*    fApp;        // The application collaborator.
  40.         enum
  41.         {        // ADB key codes for TDoc::IsThisKeyDown()
  42.             kCommandKey =    0x37,
  43.             kShiftKey =        0x38,
  44.             kCapsLockKey =    0x39,
  45.             kOptionKey =    0x3A,
  46.             kControlKey =    0x3B
  47.         };
  48.         virtual Boolean IsThisKeyDown(const short theKey);
  49.     public:
  50.                 // Constructor and destructor
  51.         TDoc(short resID);
  52.         virtual ~TDoc();
  53.                 // Overrides from TDocument
  54.         override void DoContent(EventRecord* /*pEvent*/) {;}
  55.         override void DoUpdate();
  56.                 // New functions
  57.         virtual void Erase();
  58.         virtual void Hide();
  59.         virtual void Invalidate();
  60.         virtual Boolean IsWindowVisible();
  61.         virtual void SetApp(TApp* theApp) {this->fApp = theApp;}
  62.         virtual void Show();
  63.         virtual void Toggle();
  64.                 // Functions to override
  65.         virtual void DoIdle() {;}
  66.         virtual void Draw() {;}
  67. };
  68.  
  69. // ------------------------------------------------------------------------
  70. // A class for the clipboard window.
  71. // Manages everything inside the window.
  72. class TDocClip : public TDoc
  73. {
  74.     private:
  75.         TScrap*        fScrap;        // The scrap collaborator.
  76.     protected:
  77.     public:
  78.                 // Constructor
  79.         TDocClip(short resID);
  80.                 // Overrides
  81.         override void Draw();
  82.                 // New functions
  83.         virtual void SetScrapObj(TScrap* scrapObj) {this->fScrap=scrapObj;}
  84. };
  85.  
  86. #endif __UDOC__